<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   <script>
     function countDown(time) {
        var time1 = +new Date()
        var time2 = +new Date(time)
        var timer = (time2 - time1) / 1000;
        var d = parseInt(timer / 60 / 60 /24);
        d = d < 10 ? '0' + d :d;
        var h = parseInt(timer /60 / 60 % 24);
        h = h < 10 ? '0' + h :h;
        var m = parseInt(timer / 60 %60);
        m = m < 10 ? '0' + m :m;
        var s = parseInt(timer %60);
        s = s < 10 ? '0' + s :s;
        
        return d + '天' + h + '时' + m + '分' + s + '秒'
     }
     var time3 = countDown('2022-9-6 23:30:30');
     console.log(time3);
     var date = new Date();
     console.log(date);
   </script>
</head>
<body>
    
</body>
</html>